import request from '@/utils/request'

export const getRole = params => request.get('/sys/role', { params })

export const getEnabledRole = () => request.get('/sys/role/list/enabled')

export const newRole = (data) => request.post('/sys/role', data)

export const removeRole = (id) => request.delete(`/sys/role/${id}`)

export const editRole = data => request.put(`/sys/role/${data.id}`, data)

export const getRoleDetail = (id) => request.get(`/sys/role/${id}`)

export const getRoleInfo = (id) => request.get(`/sys/user/${id}`)

export const assignRoles = data => request.put('/sys/user/assignRoles', data)

